Create a Script

You can create scripts, specify the devices on which you want to run the scripts.

Add a script

To create a script,

  1. Navigate to Libraries > Scripting.
  2. On the Scripting page, click Add New to open the Add New Script pane.
  3. Enter the script details:
    • Script Name - Add a meaningful script title in the box.
    • Script text box - Enter the script text in one of following ways.
      • Type the script manually in the text box.
      • Drag and drop an existing script file into the text box.
      • Upload a script file - To upload a script file, follow the steps -
        • Click Select File.
        • Browse to the file location.
        • Select the desired script file to upload.
    • Script File - The script name entered in the Script Name field populates here.
    • Select OS - Select Windows or macOS.
    • Select Language - Select the script language. Add the script in the text box below.

      NOTE: Once you create the script, the OS and the Language settings cannot be modified.

    • In the Properties section,
      • Description - Add details or information related to the script.
      • Publication Status -
        Draft - Select this option if the script is a work in progress. You can test it on demand on device(s).
        Published - Select this option if the script is ready. You can test it on demand on device(s).
    • In the Requirements section,
      • Operating System- if selected earlier, the operating system is auto selected.
      • Language - If selected earlier, the field is auto-populated. If you select PowerShell, ensure yo add a correct version in the next field.
      • PowerShell Version : Select the PowerShell version from the drop-down list.
        Ensure that the selected version of PowerShell is installed on each target device before attempting to run the script.
      • Dependencies: Attach necessary dependency files. For more information, see Adding Dependencies.
    • In the Execution section, the settings can be overridden when running the script on demand or linking it to a policy.
      • User Account - Select the option from the following.
        System - Select this option if you want to run the script as the Local System or root account.
        Current User - Select this option if you want to run the script as currently logged user account.
      • Timeout - Choose a duration from the drop-down. The script automatically stops running when the selected timeout period is reached.
    • In the Input section, the settings can be overridden when running the script on demand or linking it to a policy.
    • In the Triggers section, choose when the script should run on devices if linked to a policy.
      • After a device starts up - The script executes when the system starts
      • After a user logs on - The script executes when the user logs on.
      • On a schedule - The script runs on specified days, weeks, or times. When you select this option, you must specify the schedule by clicking Add Schedule.
      • For more information on Triggers, see Adding Triggers to a Script .

    • In the Testing section, you run the script to test if it is working fine.
      For more information on Testing, refer Testing a Script topic.
  4. Click Save and Publish to publish the script or Save as Draft to save the script as a draft.
    If a script is saved as draft, you can publish it later.